[codex] restore Codex backend provider catalog#455
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Restores a centralized Codex backend provider catalog and adds a server-parsed Codex config summary that the web settings UI can render as read-only “Codex backends,” while consolidating settings routing/pages to avoid drift across duplicate implementations.
Changes:
- Added shared Codex backend preset metadata + helpers, plus web catalog-building/rendering utilities and tests.
- Added
ServerCodexConfigSummaryto contracts and implemented server-side TOML parsing with fallback behavior (and updated provider health + SME auth validation to use it). - Consolidated settings routing so
/_chat.settings.tsxis a layout wrapper and/_chat.settings.index.tsxis the canonical settings page, adding a Codex backends section and route regression coverage.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/codexModelProviders.ts | Introduces the shared Codex backend preset catalog and helper functions. |
| packages/shared/src/codexModelProviders.test.ts | Adds regression tests for preset ordering, built-in detection, and lookup helpers. |
| packages/shared/package.json | Exposes the new shared catalog via package exports. |
| packages/contracts/src/server.ts | Extends ServerConfig schema to include codexConfig. |
| packages/contracts/src/index.ts | Re-exports the new Codex config contract types. |
| packages/contracts/src/codexConfig.ts | Adds schema/types for ServerCodexConfigSummary and provider entries. |
| bun.lock | Adds the toml dependency to the lockfile. |
| apps/web/src/routes/_chat.settings.tsx | Converts the settings route into a layout wrapper providing settings context + outlet. |
| apps/web/src/routes/_chat.settings.index.tsx | Makes this the canonical settings page and adds a read-only Codex backends section + refactors provider metadata usage. |
| apps/web/src/routes/-_chat.settings.route.browser.tsx | Adds browser regression test ensuring /settings and /settings/ render the canonical page. |
| apps/web/src/lib/settingsProviderMetadata.tsx | Centralizes settings provider install/auth metadata and ordering. |
| apps/web/src/lib/providerAvailability.ts | Extends thread-provider selection logic to consider Claude auth token helper configuration. |
| apps/web/src/lib/codexBackendCatalog.ts | Builds a UI-ready Codex backend catalog by merging shipped presets with detected config entries. |
| apps/web/src/lib/codexBackendCatalog.test.ts | Tests catalog merging, implicit default behavior, and curated selection status. |
| apps/web/src/lib/claudeAuthTokenHelperPresets.ts | Adds preset commands for Claude auth token helper configuration. |
| apps/web/src/components/settings/SettingsRouteContext.tsx | Updates dirty-state tracking for new Claude helper and additional custom model settings. |
| apps/web/src/components/settings/CodexBackendSection.tsx | Implements settings UI section to render built-in/curated/custom Codex backends + parse warnings. |
| apps/web/src/components/settings/CodexBackendSection.test.tsx | Tests parse-warning rendering while retaining selected backend visibility. |
| apps/web/src/components/KeybindingsToast.browser.tsx | Updates test server-config fixture to include codexConfig. |
| apps/web/src/components/ChatView.browser.tsx | Updates test server-config fixture to include codexConfig. |
| apps/web/src/appSettings.ts | Adds claudeAuthTokenHelperCommand setting and threads it into provider start options. |
| apps/server/src/wsServer.ts | Includes codexConfig summary in server.getConfig responses. |
| apps/server/src/wsServer.test.ts | Updates websocket server tests to expect codexConfig and stabilizes CODEX_HOME during tests. |
| apps/server/src/sme/authValidation.ts | Reuses shared Codex config summary parsing to validate Codex SME auth mode selection. |
| apps/server/src/sme/authValidation.test.ts | Adds coverage for Codex auth validation behavior based on configured backend. |
| apps/server/src/provider/codexConfig.ts | Implements TOML parsing + fallback scanning and exposes normalized config summary helpers. |
| apps/server/src/provider/codexConfig.test.ts | Adds coverage for parsing, custom IDs, section scoping, and malformed TOML fallback. |
| apps/server/src/provider/Layers/ProviderHealth.ts | Replaces custom line-scan logic with shared Codex config summary and adjusts auth-probe behavior/messages. |
| apps/server/src/provider/Layers/ProviderHealth.test.ts | Updates provider health tests to validate auth-probe skipping across non-OpenAI backends. |
| apps/server/package.json | Adds toml as a server dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/2fef1788-3f93-4657-95e2-921b05c337f3 Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CODEX_HOME/config.tomlonce on the server and expose a normalizedcodexConfigsummary to the web_chat.settings.index.tsxis the single canonical settings page and add a read-onlyCodex backendssectionWhy
The provider list had drifted because the settings UI and server-side Codex config detection were split across duplicate implementations. That left the web with stale backend coverage and the server with duplicate line-scanning logic.
What changed
/settingsroutingValidation
bun fmtbun lintbun typecheckcd packages/shared && bun run test -- src/codexModelProviders.test.tscd apps/server && bun run test -- src/provider/codexConfig.test.ts src/sme/authValidation.test.ts src/provider/Layers/ProviderHealth.test.tscd apps/web && bun run test -- src/lib/codexBackendCatalog.test.ts src/components/settings/CodexBackendSection.test.tsx